<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>destructuring</title>
</head>
<body>
<script>
// 对象的解构赋值
    /*var {b,a}={a:1,c:3,b:2};
    console.log(a); /!*1*!/
    console.log(b);/!*2*!/*/
    // 变量名和 对象的key值不一致,起别名
    // demo1
    /*var {b:m_b,a:m_a}={a:1,c:3,b:2};
    console.log(m_a); /!*1*!/
    console.log(m_b); /!*2*!/*/

    // demo2
    let object={a:1,b:2};
    let {a:ma,b:mb}=object;
    console.log(ma);
    console.log(mb);
</script>
</body>
</html>